#ifndef TRANSACTION_HH
#define TRANSACTION_HH

#include <string>
#include <vector>
#include <iostream>

enum class TransactionType {
    Deposit,
    Withdraw,
    Transfer
};

class Transaction {
private:
    static int nextID;  // 静态成员变量，用于生成交易ID
    int transactionID;  // 使用整数类型作为交易ID
    double amount;
    std::string note;
    time_t timestamp;   // 使用 time_t 来表示时间戳
    TransactionType type;

    std::string fromAccount;  
    std::string toAccount;    

    
public:
    Transaction(double amt, const std::string& n, TransactionType t, const std::string& from = "", const std::string& to = "");

    int getID() const;
    TransactionType getType() const;
    double getAmount() const;
    time_t getTime() const;
    std::string getNote() const;

    std::string getFrom() const;
    std::string getTo() const;

    std::string toString() const;

};

#endif
